<template>
	<view class="ComBox">
		<div class="ComList" v-for="item in ComListSon" :key="index" @click="goToDetail(item.goodsID)">
			<div class="ImgBOX">
				<img :src="item.goodsImgUrl" class="Img" alt="">
			</div>
			<div class="Title">
				{{item.goodsName}}
			</div>
			<div class="Price">
				￥{{item.price}}
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ComList: [], //被合并的列表
				ComListSon: [],
			};
		},
		props: {
			ComListSon: {
				type: Array,
				required: true // 你可以根据需要设置这个属性是否必需
			}
		},
		methods: {
			//详情
			goToDetail(goodsID) {
				uni.setStorageSync('goodsID', goodsID)
				uni.navigateTo({
			
					url: '/subpages/detail/detail?goodsID=${goodsID}'
				});
				console.log(typeof(goodsID))
			},
		},
		onLoad() {
			this.page = 1
			this.getComList()
		},
		onReachBottom: function() {
			//下拉触发事件
			// this.page++;
			// this.getDefault(this.page);
			console.log('触发了下拉加载更多的事件')
		}
	};
</script>
<style lang="scss" scoped>
	@use "waterFall";
</style>